/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VentanaAgregarEmpleadoTienda.java
 *
 * Created on 04/01/2009, 04:00:46 PM
 */

package com.wd.gui;

import com.wd.dominio.Empleado;
import com.wd.dominio.HistorialEmpleado;
import com.wd.dominio.Lugar;
import com.wd.gui.controlparticular.ControlGuiEmpleadoTienda;
import com.wd.servicios.ControlGeneral;
import com.wd.servicios.IfaceControlGeneral;
import java.util.Date;
import java.util.Collection;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author gerardo
 */
public class VentanaConsultarEditarEmpleadoTienda2 extends javax.swing.JFrame {

    private ControlGuiEmpleadoTienda controlGui = new ControlGuiEmpleadoTienda();
    private IfaceControlGeneral controlG = ControlGeneral.getInstance();
    private Collection<Lugar> Cciudades;
    private Empleado empleado;
    private Collection<HistorialEmpleado> coleccionHistorial;
    private int codigoTienda;
    private boolean flag = false;
    private int cargoActualcod;


    /** Creates new form VentanaAgregarEmpleadoTienda */
    public VentanaConsultarEditarEmpleadoTienda2(int cedula) {
        initComponents();

        java.net.URL url = getClass().getResource("Iconos/icon_016.png");
        java.awt.Image imagen = getToolkit().getImage(url);
        setIconImage (imagen);

        Collection<Lugar> ciudades = controlG.traerTodosLosLuagres(2);

        empleado = controlGui.consultarEmpleado(cedula);

        Empleado ciudad = null;
        for (Lugar ciudads : ciudades) {
            this.jcUbicacion.addItem(ciudads.getNombrePropio());
            if (empleado.getLugarId() == ciudads.getId()) {
               ciudad = empleado;
            }
        }
        this.jcUbicacion.setSelectedItem(ciudad.getCiudadVive());
        this.controlGui = new ControlGuiEmpleadoTienda();       
        this.Cciudades = ciudades;

        Integer a = cedula;
        String cel = a.toString();
        this.jtCedula.setText(cel);

        this.jtApellido.setText(empleado.getApellido());
        this.jtDireccion.setText(empleado.getDireccion());
        this.jtTelefono.setText(empleado.getTelefono());
        this.jtNombre.setText(empleado.getNombre());
        this.jfFechaNac.setDate(empleado.getFechaNacimiento());
        this.jcCargo.setSelectedIndex(empleado.getTipo());
        this.jcEdoCivil.setSelectedIndex(empleado.getEstadoCivil());
        this.jcNivelEstudios.setSelectedIndex(empleado.getNivelEstudios());
        this.traducirSexo(empleado.getSexo());
        Collection<HistorialEmpleado> historial = empleado.getHistorial();
        Vector vec = new Vector (historial);
        HistorialEmpleado he = (HistorialEmpleado) vec.get(vec.size() -1);
        this.jtTienda.setText(he.getNombreEmpresa());
        this.codigoTienda = he.getCodigo();
        this.cargoActualcod = he.getCargo();


        this.coleccionHistorial = empleado.getHistorial();

        DefaultTableModel dm1 = new DefaultTableModel();
        dm1.addColumn("Nombre Tienda");
        dm1.addColumn("Fecha Inicio");
        dm1.addColumn("Fecha Fin");
        dm1.addColumn("Cargo");

        for (HistorialEmpleado hemp : this.coleccionHistorial) {
            Vector info = new Vector();

            info.addElement(hemp.getNombreEmpresa());
            info.addElement(hemp.getFechaInicio());
            if (hemp.getFechaFin() == null) info.addElement("--");
            else info.addElement(hemp.getFechaFin());
            info.addElement(this.traducirCargo(hemp.getCargo()));
            dm1.addRow(info);
        }
       this.tablaHisto.setModel(dm1);
    }

    private void traducirSexo (String arg) {
        if (arg.equals("M")) this.jrMasculino.setSelected(true);
        else if (arg.equals("F")) this.jrFemenino.setSelected(true);
    }

    private String traducirCargo (int arg) {
        switch (arg) {
            case 0: return "Gerente";
            case 1: return "Regular";
            default : return "Indefinido";
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jtNombre = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jtApellido = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jfFechaNac = new com.toedter.calendar.JDateChooser();
        jLabel5 = new javax.swing.JLabel();
        jrMasculino = new javax.swing.JRadioButton();
        jrFemenino = new javax.swing.JRadioButton();
        jLabel6 = new javax.swing.JLabel();
        jcEdoCivil = new javax.swing.JComboBox();
        jLabel7 = new javax.swing.JLabel();
        jcNivelEstudios = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        jcUbicacion = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jtTelefono = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtDireccion = new javax.swing.JTextArea();
        jtCedula = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jcCargo = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        jtTienda = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tablaHisto = new javax.swing.JTable();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTable1);

        setTitle("Consulta de Empleado");
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos del Empleado", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), null)); // NOI18N
        jPanel1.setAutoscrolls(true);

        jLabel1.setText("Nombre:");

        jLabel2.setText("Apellido:");

        jLabel3.setText("Cedula de Identidad:");

        jLabel4.setText("Fecha Nacimiento:");

        jfFechaNac.setDateFormatString("yyyy/MM/dd");

        jLabel5.setText("Sexo:");

        jrMasculino.setText("Masculino");
        jrMasculino.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrMasculinoActionPerformed(evt);
            }
        });

        jrFemenino.setText("Feminino");
        jrFemenino.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrFemeninoActionPerformed(evt);
            }
        });

        jLabel6.setText("Estado civil:");

        jcEdoCivil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "soltero", "casado", "divorciado", "viudo" }));

        jLabel7.setText("Nivel de estudios:");

        jcNivelEstudios.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "ninguno", "educacion primaria", "educacion secuandaria", "educacion superior" }));

        jLabel8.setText("Ubicación:");

        jLabel9.setText("Teléfono:");

        jLabel10.setText("Dirección:");

        jtDireccion.setColumns(20);
        jtDireccion.setLineWrap(true);
        jtDireccion.setRows(5);
        jScrollPane1.setViewportView(jtDireccion);

        jtCedula.setFont(new java.awt.Font("DejaVu Sans", 1, 12));
        jtCedula.setForeground(new java.awt.Color(45, 132, 45));
        jtCedula.setText("jLabel13");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jtNombre, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jtApellido, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(jfFechaNac, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(jLabel5)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jrMasculino)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrFemenino))
                    .addComponent(jLabel6)
                    .addComponent(jcEdoCivil, 0, 237, Short.MAX_VALUE)
                    .addComponent(jLabel7)
                    .addComponent(jcNivelEstudios, 0, 237, Short.MAX_VALUE)
                    .addComponent(jLabel8)
                    .addComponent(jcUbicacion, 0, 237, Short.MAX_VALUE)
                    .addComponent(jLabel9)
                    .addComponent(jtTelefono, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(jLabel10)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(jtCedula))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtCedula)
                .addGap(22, 22, 22)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jfFechaNac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrMasculino)
                    .addComponent(jrFemenino))
                .addGap(18, 18, 18)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jcEdoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jcNivelEstudios, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jcUbicacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(33, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cargo Actual y TIenda", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), null)); // NOI18N

        jLabel11.setText("Cargo:");

        jcCargo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "gerente", "empleado regular" }));
        jcCargo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcCargoActionPerformed(evt);
            }
        });

        jLabel12.setText("Tienda donde trabaja:");

        jtTienda.setText("jLabel14");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jcCargo, 0, 218, Short.MAX_VALUE)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12)
                    .addComponent(jtTienda))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel11)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jcCargo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(28, 28, 28)
                .addComponent(jLabel12)
                .addGap(18, 18, 18)
                .addComponent(jtTienda)
                .addContainerGap(37, Short.MAX_VALUE))
        );

        jButton1.setText("Guardar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Cerrar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Historial", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), null)); // NOI18N

        tablaHisto.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane3.setViewportView(tablaHisto);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 425, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(95, 95, 95))
                        .addGroup(layout.createSequentialGroup()
                            .addGap(6, 6, 6)
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addContainerGap()))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1)
                        .addGap(18, 18, 18)
                        .addComponent(jButton2)
                        .addGap(63, 63, 63))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 166, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton1)
                            .addComponent(jButton2))
                        .addGap(52, 52, 52))
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jrFemeninoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrFemeninoActionPerformed
        if (jrFemenino.isSelected()) {
            this.jrMasculino.setSelected(false);
        }
}//GEN-LAST:event_jrFemeninoActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        String nombreEmpleado        = this.jtNombre.getText();
        String apellidoEmpleado      = this.jtApellido.getText();
        String direccionEmpleado     = this.jtDireccion.getText();
        String telefonoEmpleado      = this.jtTelefono.getText();
        Date fechaNac                = this.jfFechaNac.getDate();
        String sexo                  ="";
        java.sql.Date fechaEmpleado = new java.sql.Date(fechaNac.getTime()); // Conviertiendo de java.util.Date a java.sql.date
        //Para determinar el sexo
        if (this.jrFemenino.isSelected()) sexo = "F";
        else sexo = "M";
        int cargo = this.jcCargo.getSelectedIndex();
        int nivelEstudios = this.jcNivelEstudios.getSelectedIndex();
        int estadoCivil = this.jcEdoCivil.getSelectedIndex();

        int indiceCiudad = this.jcUbicacion.getSelectedIndex();

        Vector<Lugar> ciudades = new Vector(this.Cciudades);
        Lugar ciudadSeleccionada = ciudades.get(indiceCiudad);
        int ciudadEmpleado = ciudadSeleccionada.getId();
        this.controlGui.actualizarEmpleado(this.flag,empleado.getCedula(), nombreEmpleado,
                apellidoEmpleado, fechaEmpleado,telefonoEmpleado, estadoCivil,
                sexo, nivelEstudios, direccionEmpleado, cargo, ciudadEmpleado,
                "", this.codigoTienda, "");
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        this.setVisible(false);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jrMasculinoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrMasculinoActionPerformed
        if (jrMasculino.isSelected()) {
            this.jrFemenino.setSelected(false);
        }
    }//GEN-LAST:event_jrMasculinoActionPerformed

    private void jcCargoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcCargoActionPerformed
        if (this.cargoActualcod == this.jcCargo.getSelectedIndex()) {
            this.flag = false;
        }
        else {
            this.flag = true;
        }
    }//GEN-LAST:event_jcCargoActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run(int cedula) {
                new VentanaConsultarEditarEmpleadoTienda2(cedula).setVisible(true);
            }

            public void run() {
                throw new UnsupportedOperationException("Not supported yet.");
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    private javax.swing.JComboBox jcCargo;
    private javax.swing.JComboBox jcEdoCivil;
    private javax.swing.JComboBox jcNivelEstudios;
    private javax.swing.JComboBox jcUbicacion;
    private com.toedter.calendar.JDateChooser jfFechaNac;
    private javax.swing.JRadioButton jrFemenino;
    private javax.swing.JRadioButton jrMasculino;
    private javax.swing.JTextField jtApellido;
    private javax.swing.JLabel jtCedula;
    private javax.swing.JTextArea jtDireccion;
    private javax.swing.JTextField jtNombre;
    private javax.swing.JTextField jtTelefono;
    private javax.swing.JLabel jtTienda;
    private javax.swing.JTable tablaHisto;
    // End of variables declaration//GEN-END:variables

}
